import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import MemberRecharge from "../views/MemberRecharge.vue";
import SportsKnowledge from "../views/SportsKnowledge.vue";
import VenueDynamics from "../views/VenueDynamics.vue";
import VenueReservation from "../views/VenueReservation.vue";
import SiteEnvironment from "../views/SiteEnvironment.vue";
import AppointmentOrder from "../views/AppointmentOrder.vue";
import PersonalInfo from "../views/PersonalInfo.vue";
import SportsKnowledgeDetails from "@/views/SportsKnowledgeDetails";
import VenueDynamicsDetails from "@/views/VenueDynamicsDetails.vue";
import UserLogin from "@/views/UserLogin.vue";
import FirstPage from "@/views/FirstPage.vue";
import UserRegister from "@/views/UserRegister.vue";

const routes = [
  {
    path: '/login',
    name: 'login',
    component: UserLogin
  },
  {
    path: '/register',
    name: 'register',
    component: UserRegister
  },
  {
    path: '/',
    redirect: '/login',
  },

  {
    path: '/home',
    name: 'home',
    redirect:'/firstPage',
    component: HomeView,
    children:[
      {
        path: '/firstPage',
        name: 'firstPage',
        component: FirstPage
      },
      {
        path: '/memberRecharge',
        name: 'memberRecharge',
        component: MemberRecharge
      },{
        path: '/sportsKnowledge',
        name: 'sportsKnowledge',
        component: SportsKnowledge
      },{
        path: '/venueDynamics',
        name: 'venueDynamics',
        component: VenueDynamics
      },{
        path: '/venueReservation',
        name: 'venueReservation',
        component: VenueReservation
      },{
        path: '/siteEnvironment',
        name: 'siteEnvironment',
        component: SiteEnvironment
      },
      {
        path: '/personalInfo',
        name: 'personalInfo',
        component: PersonalInfo
      },
      {
        path: '/appointmentOrder',
        name: 'appointmentOrder',
        component: AppointmentOrder
      },
      {
        path: '/sportsKnowledgeDetails',
        name: 'SportsKnowledgeDetails',
        component: SportsKnowledgeDetails
      },
      {
        path: '/venueDynamicsDetails',
        name: 'VenueDynamicsDetails',
        component: VenueDynamicsDetails
      }
    ]

  },


  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
